<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org"
      xmlns:shiro="http://www.pollix.at/thymeleaf/shiro" xmlns:tang="">
<head>
    <meta charset="UTF-8"/>
    <title>role list</title>
    <link rel="stylesheet" th:href="@{/css/css.css}">
</head>
<body>
<div class="message" th:text="${msg}" th:if="${msg!=null}"></div>
<shiro:hasPermission name="role:create">
    <a th:href="@{/role/create}">角色新增</a><br/>
</shiro:hasPermission>
<table class="table">
    <thead>
    <tr>
        <th>角色名称</th>
        <th>角色描述</th>
        <th>拥有的资源</th>
        <th>操作</th>
    </tr>
    </thead>
    <tbody>
    <tr th:each="role:${roleList}">

        <td th:text="${role.role}"></td>

        <td th:text="${role.description}"></td>
        <td tang:replace_string="resource_list:${role.resourceIds}"></td>

        <td>
            <shiro:hasPermission name="role:update">
                <a th:href="'/role/'+${role.id}+'/update'">修改</a>
            </shiro:hasPermission>
            <shiro:hasPermission name="role:delete">
                <a th:href="'/role/'+${role.id}+'/delete'">删除</a>
            </shiro:hasPermission>
        </td>

    </tr>

    </tbody>

</table>


</body>
</html>